<template>

<div class="wrap w-rzcg detail">
    <header>
        <img onclick="javascript :history.back(-1);" src="@/assets/img/l_b.png" alt="" />
        认证
    </header>
    <div class="box">
        <img src="@/assets/img/register_success.png" alt="" />
        <p>{{info}}</p>
        <button type="button" @click="toIndex">查看竞价信息</button>
        <button type="button" v-if="rePush" @click="toRegister">重新认证</button>

    </div>

</div>

</template>
<script>
    
export default {
  data(){
    return{
          info:'',
          rePush:false,
     }
  },
  async created(){
    let info = ''
    let re = await this.$axios.post('user/getUserByToken')
        if(re.code == 200){
              if(re.data.user_status ==0){
                this.$router.push({path:'/register/status'})

              }else if(re.data.user_status ==1){
                info = "等待审核，小麦正在紧急审核中...";

              }else if(re.data.user_status ==2){
                info = "恭喜,审核通过了!";

              }else if(re.data.user_status ==3){
                info = "您的审核被驳回了,请联系客服";
                this.rePush = true

              }
              this.info = info
          
         }
  },
  
  mounted(){
            
  },
  
  methods:{
   async toRegister(){
          let re = await this.$axios.post('user/getUserByToken')
          if(re.code == 200){
              if(re.data.user_type ==10){
                  this.$router.push({path:'/register/cgregister'})

              }else if(re.data.user_type ==11){
                  this.$router.push({path:'/register/gysregister'})

              }
          
           }

    },
    toIndex(){
      this.$router.push({path:'/'})
    }

  }

}
</script>
